window: Draw decorations in the right place
authorBenjamin Otte <otte@redhat.com>
Thu, 25 Feb 2016 22:20:31 +0000 (23:20 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 25 Feb 2016 22:21:29 +0000 (23:21 +0100)
When we draw our own shadows, we need to offset the calls to render the
background to the border rectangle.

gtk/gtkwindow.c

index 4b686a16ee010ef68c92936c1b0f949332cb676e..12ad04033417334b892b53b6202c3760c7d681c1 100644 (file)
@@ -9902,18 +9902,24 @@ gtk_window_draw (GtkWidget *widget,
 
           if (priv->use_client_shadow)
             {
+              GtkBorder padding, border;
+
+              gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &padding);
+              gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
+              sum_borders (&border, &padding);
+
               gtk_render_background (context, cr,
-                                     window_border.left, window_border.top,
+                                     window_border.left - border.left, window_border.top - border.top,
                                      allocation.width -
-                                     (window_border.left + window_border.right),
+                                     (window_border.left + window_border.right - border.left - border.right),
                                      allocation.height -
-                                     (window_border.top + window_border.bottom));
+                                     (window_border.top + window_border.bottom - border.top - border.bottom));
               gtk_render_frame (context, cr,
-                                window_border.left, window_border.top,
+                                window_border.left - border.left, window_border.top - border.top,
                                 allocation.width -
-                                (window_border.left + window_border.right),
+                                (window_border.left + window_border.right - border.left - border.right),
                                 allocation.height -
-                                (window_border.top + window_border.bottom));
+                                (window_border.top + window_border.bottom - border.top - border.bottom));
             }
           else
             {